/** 
 * ColorAction.java
 * @author Lex
 * 2007-8-27 ����08:14:02
 */
package fun.ui.canvas.control;

import java.awt.event.ActionEvent;

import javax.swing.JInternalFrame;

import org.lex.swing.ActionBuilder;

import fun.ui.FunMainFrame;
import fun.ui.canvas.CanvasPane;

public class ColorsAction extends ActionBuilder {
    private FunMainFrame mainframe = null;
    private JInternalFrame parent = null;
    private CanvasPane canvas = null;

    public ColorsAction(FunMainFrame mainframe, JInternalFrame parent, CanvasPane canvas) {
	super("Colors...");
	this.mainframe = mainframe;
	this.parent = parent;
	this.canvas = canvas;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
	ControlFrame frame = new ControlFrame();
	frame.setContentPane(new ColorsPane(canvas));
	frame.setTitle("Colors - " + parent.getTitle());
	frame.pack();
	frame.moveToParent(parent);
	mainframe.addInternalFrame(frame);
    }
}
